#include <stdio.h>

int main(void){
	int a,b;
	printf("1   2   3   4   5   6   7   8   9\n");
	printf("_   _   _   _   _   _   _   _   _\n");
	for (a=1;a<=9;a++){
		for (b=1;b<=9;b++){
			printf("%-4d", a*b);
		}
		printf("\n");
	}
	printf("\n");
	printf("1   2   3   4   5   6   7   8   9\n");
	printf("_   _   _   _   _   _   _   _   _\n");
	for (a=1;a<=9;a++){
		for (b=1;b<=a;b++){
			printf("%-4d", a*b);
		}
		printf("\n");
	}
	printf("\n");
	printf("1   2   3   4   5   6   7   8   9\n");
	printf("_   _   _   _   _   _   _   _   _\n");
	for (a=1;a<=9;a++){
		for (b=1;b<=9;b++){
			if (b<a){
				printf("    ");
			}else{
			printf("%-4d", a*b);
			}
		}
		printf("\n");
	}
	return 0;
}
